package tech.daoxuan.findresources.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.daoxuan.findresources.utils.RedisUtil;

import java.util.List;

@RestController
@RequestMapping("/redis")
public class GetInfoFromRedisController {

    @Autowired
    private RedisUtil redisUtil;

    @GetMapping("/{key}")
    public List<Object> getInfoByKeyFromRedis(@PathVariable String key){
        key="kks";
        List<Object> objects = redisUtil.lGet(key, 0, -1);
        return objects;

    }

}
